<!DOCTYPE html>
<html lang="en">
<head>
<body>
<h1>基本的DOM操作</h1>

<input id="v" type="text" value="1">
<button onclick="modify(1)">加</button>
<button onclick="modify(-1)">减</button>
<script lang="javascript">
    function modify(x){
        var num = document.getElementById('v')
        num.value = parseInt(num.value) + x
    }

</script>


</body>
</html>

